#!/bin/bash

help() {
  echo "Usage:"
  echo "  swarm version <service>"
  echo ""
  echo "    -h, --help              Get help"
  echo "    -u, --update <version>  Set new version"
}

core() {
  local service=$1
  if [ "$service" = "" ]; then
    log::error "service is required"
    exit 1
  fi

  cd $SWARM_PLUGIN_SERVICE_PATH/$service
  if [ ! -f .env ]; then
    log::error "Please use .env instead of write all config in docker-compose.yml"
    exit 1
  fi

  . .env
  echo $VERSION
}

run() {
  core $@
}

run $@
